<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <title><%= post.title %></title>
    <link rel='stylesheet' href='/stylesheets/style.css'>
    <link rel='stylesheet' href='/stylesheets/header.css'>
    <link rel="stylesheet" href="/stylesheets/article.css">
</head>
<body>
	<%- include header.ejs%>
	<article class="article">
	    <% if (success) { %>
	    <div><%= success %></div>
	    <% } %>
	    <% if (error) { %>
	    <div><%= error %></div>
	    <% } %>
		<% if(user &&(user.name==post.name)) { id = post._id.toString(); %>
		<a href="/edit/<%= id %>">修改</a>
		<a href="/remove/<%= id %>">删除</a>
		<% } %>
		<h2 class="title"><%= post.title %></h2>
		<hr>
		<p class="writer">作者：<a href="/u/<%= post.name %>"><%= post.name %></a>|发布时间：<%= post.time.minute %></p>
		<p class="artilce-body"><%- post.post %></p>
		<p class="pv-comments">阅读：<%= post.pv %>|评论：<%= post.comments.length %></p>
		<hr>
		<%- include comment.ejs %>
	</article>
</body>
</html>
